<div class="findtrs" >
	<form action="{:url('msjpayWait')}" class="layui-inline layui-form" method="post" style="width: 100%;">
		<div class="ftitle">
			<div class="lt">
				<h2>聚合支付</h2>
			</div>
		</div>
		<div class="fremittanpred fbai" style="height: 650px" >
			<div class="txt">
				<p>完成支付操作后，会自动跳转到充值列表。</p>
			</div>
			<div class="list">
				<ul>
					<li style="width: 200px;">
						<label>充值金额 <i>*</i></label>
						<select name="money" id="money" lay-filter="money" lay-verify="required" lay-verType="tips">
							<option value="50">$ 50</option>
							<option value="60">$ 60</option>
							<option value="70">$ 70</option>
							<option value="80">$ 80</option>
							<option value="90">$ 90</option>
							<option value="100">$ 100</option>
							<option value="150">$ 150</option>
						</select>
					</li>
					<li style="width: 200px;">
						<label>支付方式 <i>*</i></label>
						<select name="pay_type" id="pay_type"  lay-verify="required" lay-verType="tips">
							{if $fund_msjpay_alipay == 1}
							<option value="alipay">支付宝</option>
							{/if}
							{if $fund_msjpay_wx == 1}
							<option value="wechatpay">微信</option>
							{/if}
						</select>
					</li>
				</ul>
			</div>
			<div class="fdetail">
				<ul>
					<li>
						<i style="font-size: 20px;">
							<span style="font-weight: bold;color: red">*</span>
							<a href="javascript:;" style="font-size: 21px;font-weight: bold;color: red" id="ftianj">实名认证</a>({if $grade != 0}已认证{else}未认证{/if}) ,
							<a href="javascript:;" style="font-size: 21px;font-weight: bold;color: red" id="zfbzh">支付宝账号</a>({if $alipay_name != '***'}已绑定{else}未绑定{/if}) ,
							<a href="javascript:;" style="font-size: 21px;font-weight: bold;color: red" id="wxzf">微信账号</a>({if $we_chat != '***'}已绑定{else}未绑定{/if}) ,
							未认证或未绑定提交无效.
							<br/><br/>
						</i>
						<i style="font-size: 21px;font-weight: bold;color: red">* 仅支持本人名下支付宝充值 , 非本人账户可能导致封号
							<br/><br/>
						</i>
						<i style="font-size: 18px;">* 计算公式：
							<span>充值金额 + 充值金额*通道费率 + 充值金额*充值费率 =  总计($)
							</span><br/><br/>
						</i>
						<i style="color: red;font-size: 20px;">* 总计($)：
							<span id="total_money_show">${$default_amount} + $ {$default_amount} * {$pockyt_channel_rate*100}% +
								$ {$default_amount} * {$pockyt_fund_rate*100}% = $
								{$default_amount*(1+$pockyt_channel_rate+$pockyt_fund_rate)}

							</span>
						</i>
					</li>
				</ul>
			</div>
			<div class="fbottonlst" style="float: left;padding-top: 150px">
				<ul>
					<li class="on"><input type="submit" class="fsubmit" lay-submit lay-filter="edit" style="float: left" value="提 交" ></li>
					<li><a href="{:url('fund/index')}">返回</a></li>
				</ul>
			</div>
		</div>
	</form>

</div>

<script type="text/javascript">
	layui.use(['form'], function() {
		var form = layui.form;

		form.on('select(money)',function(data){
			const amount = $('#money').val();

			const pockyt_channel_rate = "{$pockyt_channel_rate}";
			const pockyt_fund_rate 	  = "{$pockyt_fund_rate}";
			var total_money = parseFloat(amount)*(1+parseFloat(pockyt_channel_rate)+parseFloat(pockyt_fund_rate));
			var total_money = total_money.toFixed(2);
			var total_money = parseFloat(total_money);
			$("#total_money_show").text("$" + amount + " + " +
					"$" + amount + " * " + pockyt_channel_rate*100 + "% + " +
					"$" + amount + " * " + pockyt_fund_rate*100 + "% " +
					" = $ " + total_money);
		})

		$('#ftianj').click(function(){
			const grade = '{$grade}';
			if(grade != 0){
				layer.msg('用户已认证', {time:1500});
				return false;
			}
			window.location.href = "{:url('user/cardCheck')}";
		})
		$('#zfbzh').click(function(){
			const alipay_name = '{$alipay_name}';
			if(alipay_name != '***'){
				layer.msg('支付宝账号已绑定', {time:1500});
				return false;
			}
			window.location.href = "{:url('user/userDetail')}";
		})
		$('#wxzf').click(function(){
			const we_chat = '{$we_chat}';
			if(we_chat != '***'){
				layer.msg('微信账号已绑定', {time:1500});
				return false;
			}
			window.location.href = "{:url('user/userDetail')}";
		})
	});
</script>